﻿using Domain.Entities;
using FluentMigrator;
using FrameworkCore.Extensions;

namespace AiBLSmartEdu.Module.Chemistry.API.Migrations;

[Migration(202409261101)]
public class ChemistryMessageAddColumn : ForwardOnlyMigration
{
    public override void Up()
    {
        Alter.Table(MigrationExpressions.GetTableName(typeof(ChemistryAsk)))
          .AddColumn(MigrationExpressions.ColumnNameFor<ChemistryAsk>(nameof(ChemistryAsk.Question))).AsString(int.MaxValue).Nullable().WithColumnDescription("询问的问题")
          .AddColumn(MigrationExpressions.ColumnNameFor<ChemistryAsk>(nameof(ChemistryAsk.Answer))).AsString(int.MaxValue).Nullable().WithColumnDescription("回复的内容")
          .AddColumn(MigrationExpressions.ColumnNameFor<ChemistryAsk>(nameof(ChemistryAsk.Type))).AsInt32().Nullable().WithColumnDescription("状态：0文本；1图片；2文件；3其它")
          .AddColumn(MigrationExpressions.ColumnNameFor<ChemistryAsk>(nameof(ChemistryAsk.IsFavorited))).AsBoolean().Nullable().WithDefaultValue(true).WithColumnDescription("是否收藏");
    }
}